{extend name="public:layout" /}
{block name="content"}
<div class="page">
  <div class="fixed-bar">
    <div class="item-title">
      <div class="subject">
        <h3>网站设置</h3>
        <h5>网站全局内容基本选项设置</h5>
      </div>
      <ul class="tab-base nc-row">
            {include file="public/nav" /}
      </ul>
  </div>
  </div>
  <!-- 操作说明 -->
  <div class="explanation" id="explanation">
    <div class="title" id="checkZoom"><i class="icon iconfont icon-dengpao"></i>
      <h4 class="itip" alt="提示相关设置操作时应注意的要点">操作提示</h4>
      <span id="explanationZoom" class="itip" alt="收起提示"></span> </div>
    <ul>
      <li>扩展配置 ，用法：模板调用标签：{literal}{:cache('Config.键名')}{/literal}，PHP代码中调用：cache('Config.键名');</li>
    </ul>
  </div>
  <!-- 表格 -->
  <form action="{:url('config/extend')}" method="post" class="form-horizontal" name="form2">
  <div class="table_list">
    <div class="mDiv"><div class="ftitle"><h3>扩展配置列表</h3><h5></h5></div></div>
    <div class="hDiv">
        <table width="100%">
        <thead>
          <tr>
            <td width="150" align="center" class="handle">操作</td>
            <td width="100" align="left">名称</td>
            <td width="120" align="center">键名</td>
            <td width="300" align="center">配置值</td>
            <td width="120" align="center">提示</td>
          </tr>
        </thead>
        </table>
    </div>

    <div class="tDiv">
      <div class="tDiv2">
             <div class="fbutton"><div class="add" id="export"><span><i class="icon iconfont icon-beifenruanjian"></i><a href="{:url('config/add')}">添加配置</a></span></div></div>
      </div>
      <div style="clear:both"></div>
    </div>

    <div class="bDiv">
      <table width="100%">
      <tbody>
        {volist name="extendList" id="vo"}
        {php}$setting = unserialize($vo['setting']);{/php}
        <tr>
          <td width="150" align="center">
          <a class="btn red" href="{:url('config/extend',array('fid'=>$vo['fid'],'action'=>'delete'))}" onclick="if(confirm('删除后将不能恢复，确认删除这  1 项吗？')){return true;} else {return false;}"><i class="fa fa-trash-o"></i>删除</a>
          </td>
          <td width="100" align="left">{$setting.title}</td>
          <td width="120" align="center">{$vo.fieldname}</td>
          <td width="300" align="center">
          {switch name="vo.type" }
          {case value="input"}
          <input type="text" class="input" style="{$setting.style}"  name="{$vo.fieldname}" value="{$Site[$vo['fieldname']]}">
          {/case}

          {case value="select"}
          <select name="{$vo.fieldname}">
          {volist name="setting['option']" id="rs"}
               <option value="{$rs.value}" {if condition=" $Site[$vo['fieldname']] == $rs['value'] "}selected{/if}>{$rs.title}</option>
          {/volist}
          </select>
          {/case}

          {case value="textarea"}
          <textarea name="{$vo.fieldname}" style="{$setting.style}">{$Site[$vo['fieldname']]}</textarea>
          {/case}

          {case value="radio"}
          {volist name="setting['option']" id="rs"}
          <input name="{$vo.fieldname}" value="{$rs.value}" type="radio"  {if condition=" $Site[$vo['fieldname']] == $rs['value'] "}checked{/if}> {$rs.title}
          {/volist}
          {/case}

          {case value="password"}
          <input type="password" class="input" style="{$setting.style}"  name="{$vo.fieldname}" value="{$Site[$vo['fieldname']]}">
          {/case}
          {/switch}
          </td>
          <td width="120" align="center">{$setting.tips}</td>
        </tr>
        {/volist}
      </tbody>
      </table>
      <div class="fix-bot"><a href="JavaScript:void(0);" class="ncap-btn-big ncap-btn-green" onclick="document.form2.submit()">确认提交</a></div>
    </div>
  </div>
  </form>
</div>
{/block}